import ElementPlus from 'element-plus'
import './assets/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
//< 为 vuetify 的组件提供全局配置
import 'vuetify/styles';
import { createVuetify } from 'vuetify';
//>>
// <<为 arco-design 的组件提供全局配置 
import ArcoVue from '@arco-design/web-vue'; // 引入arco-design-vue
import ArcoVueIcon from '@arco-design/web-vue/es/icon'; // 引入arco-design-vue图标
import '@arco-design/web-vue/dist/arco.css';
//>>
//<< 为 element-ui 的组件提供全局配置
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import "element-plus/dist/index.css"
//>>

// 导入自定义指令
// import perm from './directivces/perm'
import App from './App.vue'
// import App from './recruitment/index.vue'
import router from './router'
import zhCn from 'element-plus/es/locale/lang/zh-cn' // 设置中文语言包

import ECharts from 'vue-echarts'
import { use } from 'echarts/core'

// 引入需要的图表和组件
import {
  BarChart,
  LineChart,
  PieChart
} from 'echarts/charts'
import {
  TitleComponent,
  TooltipComponent,
  LegendComponent,
  GridComponent,
  DatasetComponent,
  TransformComponent
} from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'

// 注册组件
use([
  BarChart,
  LineChart,
  PieChart,
  TitleComponent,
  TooltipComponent,
  LegendComponent,
  GridComponent,
  DatasetComponent,
  TransformComponent,
  CanvasRenderer
])



const app = createApp(App)
const vuetify = createVuetify();
app.use(router)
app.use(createPinia())
// << 为 element-plus 的组件提供全局配置
app.use(ElementPlus, { locale: zhCn })
// >>
//<< 为 vuetify 的组件提供全局配置
app.use(vuetify);
//>>
//<< 为 arco-design-vue 的组件提供全局配置
app.use(ArcoVue);
app.use(ArcoVueIcon);// 引入arco-design-vue图标
//>>

app.component('v-chart', ECharts)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// app.directive('perm', perm)
app.mount('#app')
